﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="comment.ascx.cs" Inherits="controls_client_comment" %>
<%@ Register assembly="Recaptcha" namespace="Recaptcha" tagprefix="recaptcha" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Panel ID="pComment" runat="server" Width="500px">
    <table style="width:100%;">
        <tr>
            <td>
                <asp:GridView ID="gvComment" runat="server" AutoGenerateColumns="False" 
                    AllowPaging="True" PageSize="3" Width="500px">
                    <PagerSettings FirstPageImageUrl="~/images/button/gridview/first.gif" 
                        FirstPageText="Đầu tiên" LastPageImageUrl="~/images/button/gridview/last.gif" 
                        LastPageText="Cuối cùng" Mode="NextPreviousFirstLast" 
                        NextPageImageUrl="~/images/button/gridview/next.gif" NextPageText="Sau" 
                        PreviousPageImageUrl="~/images/button/gridview/prev.gif" 
                        PreviousPageText="Trước" />
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="BÌNH LUẬN"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table style="width:100%;">
                                    <tr>
                                        <td>
                                            <asp:Label ID="cmtTitle" runat="server" Text='<%# Eval("Title") %>' 
                                                Font-Bold="True"></asp:Label>
                                            <asp:Label ID="cmtDate" runat="server" Font-Italic="True" 
                                                Text='<%# "( " + Eval("CreateDate") + " )" %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="cmtContent" runat="server" Text='<%# Eval("Content") %>'></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Label ID="cmtFullName" runat="server" 
                                                Text='<%# "Người viết : " +Eval("FullName") %>'></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle HorizontalAlign="Right" />
                    <EmptyDataTemplate>
                        <asp:Label ID="Label2" runat="server" ForeColor="#FF5050" Text="Chưa có bình luận nào !" />
                    </EmptyDataTemplate>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="pPost" runat="server">
                    <table width="500" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                &nbsp;</td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="Label3" runat="server" Font-Bold="True" Text="VIẾT BÌNH LUẬN"></asp:Label>
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:TextBox ID="txtTitle" runat="server" Width="500px"></asp:TextBox>
                                <asp:TextBoxWatermarkExtender
                                    ID="twTitle" runat="server" BehaviorID="twTitle" 
                                    TargetControlID="txtTitle" WatermarkText="Tiêu đề">
                                </asp:TextBoxWatermarkExtender>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" height="4"></td>
                        </tr>
                        <tr>
                            <td width="260">
                                <asp:TextBox ID="txtName" runat="server" Width="240px"></asp:TextBox>
                                <asp:TextBoxWatermarkExtender
                                    ID="twName" runat="server" BehaviorID="twName" TargetControlID="txtName" 
                                    WatermarkText="Họ và tên">
                                </asp:TextBoxWatermarkExtender>
                            </td>
                            <td>
                                <asp:TextBox ID="txtAddress" runat="server" Width="240px"></asp:TextBox>
                                <asp:TextBoxWatermarkExtender
                                    ID="twAddress" runat="server" BehaviorID="twAddress" 
                                    TargetControlID="txtAddress" WatermarkText="Địa chỉ">
                                </asp:TextBoxWatermarkExtender>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" height="4"></td>
                        </tr>
                        <tr>
                            <td width="260">
                                <asp:TextBox ID="txtEmail" runat="server" Width="240px"></asp:TextBox>
                                <asp:TextBoxWatermarkExtender
                                    ID="twEmail" runat="server" BehaviorID="twEmail" 
                                    TargetControlID="txtEmail" WatermarkText="Email">
                                </asp:TextBoxWatermarkExtender>
                            </td>
                            <td>
                                <asp:TextBox ID="txtPhone" runat="server" Width="240px"></asp:TextBox>
                                <asp:TextBoxWatermarkExtender
                                    ID="twPhone" runat="server" BehaviorID="twPhone" 
                                    TargetControlID="txtPhone" WatermarkText="Điện thoại">
                                </asp:TextBoxWatermarkExtender>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" height="4"></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:TextBox ID="txtContent" runat="server" Width="500px" Height="100px" 
                                    TextMode="MultiLine"></asp:TextBox>
                                <asp:TextBoxWatermarkExtender
                                    ID="twContent" runat="server" BehaviorID="twContent" 
                                    TargetControlID="txtContent" WatermarkText="Nội dung">
                                </asp:TextBoxWatermarkExtender>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" height="4"></td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <table border="0" cellpadding="0" cellspacing="0" width="100%"">
                                    <tr>
                                        <td>
                                            <recaptcha:RecaptchaControl ID="captcha" runat="server" 
                                                AllowMultipleInstances="True" 
                                                PrivateKey="6LeaeMYSAAAAACvba2fPQAswd7WpfAvekIRkYwPL" 
                                                PublicKey="6LeaeMYSAAAAAIksLTl1qOPu0F_6PmuOQVkrzYNs" />
                                        </td>
                                        <td valign="top" width="100%">
                                            <asp:Label ID="error" runat="server" ForeColor="Red" Text="Error Message !"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" height="4"></td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnSend" runat="server" Text="Gửi" Width="75px" 
                                    onclick="btnSend_Click" />
                            </td>
                            <td>
                                &nbsp;</td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Panel>
